

// 获取所有电影分类
async function getMovieTypeData() {
    const response = await fetch('http://nocat.life:3014/types/getAll')
    return response.json();
}

// 获取所有电影
async function getMovieData(params = {}) {
    const response = await fetch('http://nocat.life:3014/movies/search', {
        method: 'POST',
        headers: {
            "Content-Type": "application/json"
        },
        body: JSON.stringify(params)
    })
    return response.json();
}

// 获取所有的影院
async function getTheatreData() {
    const response = await fetch('http://nocat.life:3014/theatres/getAll')
    return response.json();
}

// 获取排片场次
async function getScheduleData(params = {}) {
    const response = await fetch('http://nocat.life:3014/schedules/search', {
        method: 'POST',
        headers: {
            "Content-Type": "application/json"
        },
        body: JSON.stringify(params)
    })
    return response.json();
}

// 获取排片场次详情
async function getScheduleDataById(_id) {
    const response = await fetch(`http://nocat.life:3014/schedules/getById?_id=${_id}`, {
        method: 'GET'
    })
    return response.json();
}
